#!/usr/bin/python
# -*- coding: utf-8 -*-

import sys

from _pylot.core.path import Path
from _pylot.core.pathbook import PathBook
from _pylot.core.system import ENCODING

try :
  __file__
except NameError :
  co = sys._getframe(0).f_code
  __file__ = co.co_filename

root = Path(__file__.decode(ENCODING)).abspath().parent.parent.parent
PYLOT_PYPYLOT_PATH = Path(__file__.decode(ENCODING)).abspath().parent

defaultconf = Path(root, u'pylot', u'etc')

hardbook = PathBook(title=u'hardbook')
hardbook.upFromFile(Path(defaultconf, u'hardbook.csv'))
for path_id in hardbook :
  if hardbook[path_id].default_value :
    new_value = hardbook[path_id].default_value.replace(u'@ROOT@', root)
    hardbook[path_id].default_value = Path(new_value).abspath()

hardbook.resetDataToDefault()

#print u'pylot informations:'
#print u'  - pylot library: %s' % hardbook(u'pythonpath')
#print u'  - default config: %s' % hardbook(u'defaultconf')
#print u'  - extensions: %s' % hardbook(u'extensions')
#print
